package medium;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author: 582895699@qq.com
 * @Desctription: 库存
 * @Date: Created in 2021/12/17 13:55
 */
@Slf4j
public class Stock {

    private static Integer COMPUTER_NUM = 100;

    public void increase(int number) {
        COMPUTER_NUM = COMPUTER_NUM + number;
        log.info("库存数据量:{}", COMPUTER_NUM);
    }

    public void deCrease(int number) {
        COMPUTER_NUM = COMPUTER_NUM - number;
        log.info("库存数据量:{}", COMPUTER_NUM);
    }

    public int getStockNumber() {
        return COMPUTER_NUM;
    }

    public void cleanStack() {
        Purchase purchase = new Purchase();
        Sale sale = new Sale();
        log.info("清理存货数量为:{}", COMPUTER_NUM);
        sale.offSale();
        purchase.refuseComputer();
    }
}
